/* Copyright (C) 2021 Wangguanbo, Calvinlin */

/* This file is part of Panda. */

/* 
  Panda is free software: you can redistribute it and/or modify 
  it under the terms of the GNU General Public License as published by 
  the Free Software Foundation, either version 3 of the License, or 
  (at your option) and later version. 
*/

/*
  Panda is distributed in the hope that it will be useful, 
  but WITHOUT ANY WARRANTY; without even the implied warranty of 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 
  GNU General Public License for more details. 
*/

/*
  You should have received a copy of the GNU General Public License 
   along with Panda. If not, see <https://www.gnu.org/licenses/>.  
*/
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "lexer.h"

char code[256];
int main(int argc, char *argv[]){//Gets each character,Call the lexical analyzer
	while(1){
		FILE *f;
		if((f=fopen(argv[1],"r"))==NULL)
		{
			printf("File open failed");
			break;
		}
		while(!feof(f)){
			fgets(code,256,f);
            int i=1;
            while(i<=256){
                lexer(code[i]);
                i++;
            }
		}
	} 
    return 0;
}
